#ifndef DRAWPICTURE_H
#define DRAWPICTURE_H

#include <QWidget>
#include <QPen>
#include <QPixmap>
#include <QPoint>
#include <QPainter>
#include <QColorDialog>
#include <QMessageBox>
#include <QPaintEvent>
#include <QTextEdit>
namespace Ui {
class drawPicture;
}

enum myShape{
    DefaultShape=0,
    Line,
    Rect,
    Round
};

class drawPicture : public QWidget
{
    Q_OBJECT

public:
    explicit drawPicture(QWidget *parent = 0);
    ~drawPicture();

private slots:
    void on_btn_save_clicked();//保存
    void on_btn_del_clicked();//删除
    void on_btn_pen_clicked();//画笔

    void on_ben_erasure_clicked();//橡皮




    void on_btn_line_clicked();//直线

    void on_btn_rect_clicked();//矩形

    void on_btn_round_clicked();//圆

    void on_btn_color_clicked();//取色器

    void on_cBox_width_currentIndexChanged(const QString &arg1);//笔宽

    void on_cBox_style_currentIndexChanged(const QString &arg1);//画笔风格

    void paintEvent(QPaintEvent* ev) override;//绘图事件

    void mouseMoveEvent(QMouseEvent* ev) override;
    void mousePressEvent(QMouseEvent* ev) override;

    void addCBox();//添加下拉框选项

    void on_btn_text_clicked();

private:
    Ui::drawPicture *ui;
    QPixmap* pix;//画布1
    QPixmap* pix2;//画布2
    QPen* pen;//画笔
    QPoint point;//鼠标点击位置坐标

    //默认画笔类型
    myShape penShape=DefaultShape;
    bool flag=false;
};

#endif // DRAWPICTURE_H
